home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue39 / ComCorn / Server_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-06  |  4.8 KB  |  110 lines

  1. unit Server_TLB;
  2.  
  3. // ************************************************************************ //
  4. // WARNING                                                                  //
  5. // -------                                                                  //
  6. // The types declared in this file were generated from data read from a     //
  7. // Type Library. If this type library is explicitly or indirectly (via      //
  8. // another type library referring to this type library) re-imported, or the //
  9. // 'Refresh' command of the Type Library Editor activated while editing the //
  10. // Type Library, the contents of this file will be regenerated and all      //
  11. // manual modifications will be lost.                                       //
  12. // ************************************************************************ //
  13.  
  14. // PASTLWTR : $Revision:   1.11.1.63  $
  15. // File generated on 10/6/98 3:01:45 AM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: C:\Delphi4\Work\AutoEvents\Server.tlb
  19. // IID\LCID: {2EA1DDA0-5CBD-11D2-9261-00104B700B61}\0
  20. // Helpfile: 
  21. // HelpString: Server Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_Server: TGUID = '{2EA1DDA0-5CBD-11D2-9261-00104B700B61}';
  38.   IID_IServerWithEvents: TGUID = '{2EA1DDA1-5CBD-11D2-9261-00104B700B61}';
  39.   DIID_IServerWithEventsEvents: TGUID = '{2EA1DDA3-5CBD-11D2-9261-00104B700B61}';
  40.   CLASS_ServerWithEvents: TGUID = '{2EA1DDA5-5CBD-11D2-9261-00104B700B61}';
  41. type
  42.  
  43. // *********************************************************************//
  44. // Forward declaration of interfaces defined in Type Library            //
  45. // *********************************************************************//
  46.   IServerWithEvents = interface;
  47.   IServerWithEventsDisp = dispinterface;
  48.   IServerWithEventsEvents = dispinterface;
  49.  
  50. // *********************************************************************//
  51. // Declaration of CoClasses defined in Type Library                     //
  52. // (NOTE: Here we map each CoClass to its Default Interface)            //
  53. // *********************************************************************//
  54.   ServerWithEvents = IServerWithEvents;
  55.  
  56.  
  57. // *********************************************************************//
  58. // Interface: IServerWithEvents
  59. // Flags:     (4416) Dual OleAutomation Dispatchable
  60. // GUID:      {2EA1DDA1-5CBD-11D2-9261-00104B700B61}
  61. // *********************************************************************//
  62.   IServerWithEvents = interface(IDispatch)
  63.     ['{2EA1DDA1-5CBD-11D2-9261-00104B700B61}']
  64.     procedure Clear; safecall;
  65.     procedure AddText(const NewText: WideString); safecall;
  66.   end;
  67.  
  68. // *********************************************************************//
  69. // DispIntf:  IServerWithEventsDisp
  70. // Flags:     (4416) Dual OleAutomation Dispatchable
  71. // GUID:      {2EA1DDA1-5CBD-11D2-9261-00104B700B61}
  72. // *********************************************************************//
  73.   IServerWithEventsDisp = dispinterface
  74.     ['{2EA1DDA1-5CBD-11D2-9261-00104B700B61}']
  75.     procedure Clear; dispid 3;
  76.     procedure AddText(const NewText: WideString); dispid 4;
  77.   end;
  78.  
  79. // *********************************************************************//
  80. // DispIntf:  IServerWithEventsEvents
  81. // Flags:     (4096) Dispatchable
  82. // GUID:      {2EA1DDA3-5CBD-11D2-9261-00104B700B61}
  83. // *********************************************************************//
  84.   IServerWithEventsEvents = dispinterface
  85.     ['{2EA1DDA3-5CBD-11D2-9261-00104B700B61}']
  86.     procedure OnTextChanged(const NewText: WideString); dispid 1;
  87.     procedure OnClear; dispid 2;
  88.   end;
  89.  
  90.   CoServerWithEvents = class
  91.     class function Create: IServerWithEvents;
  92.     class function CreateRemote(const MachineName: string): IServerWithEvents;
  93.   end;
  94.  
  95. implementation
  96.  
  97. uses ComObj;
  98.  
  99. class function CoServerWithEvents.Create: IServerWithEvents;
  100. begin
  101.   Result := CreateComObject(CLASS_ServerWithEvents) as IServerWithEvents;
  102. end;
  103.  
  104. class function CoServerWithEvents.CreateRemote(const MachineName: string): IServerWithEvents;
  105. begin
  106.   Result := CreateRemoteComObject(MachineName, CLASS_ServerWithEvents) as IServerWithEvents;
  107. end;
  108.  
  109. end.
  110.